-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to evict a container #3549
Add ability to evict a container #3549
Conversation
Hi @marcov. Thanks for your PR. I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
169147a
to
ecd82b2
Compare
9e00885
to
fa7b9b3
Compare
@mheon I'd like your feedback on this, to see if it is going in the right direction. |
☔ The latest upstream changes (presumably #3470) made this pull request unmergeable. Please resolve the merge conflicts. |
libpod/boltdb_state_internal.go
Outdated
// Evicts a container from the DB | ||
// If the config specifies a pod, the container is treated as belonging to a pod, | ||
// and will be removed from the pod as well | ||
func (s *BoltState) evictContainer(ctrID []byte, config *ContainerConfig, depCtrs []string, tx *bolt.Tx) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. I think we can reuse RemoveContainer()
here - it doesn't actually need anything in the container state.
We can make a Container struct with a ContainerConfig we get out of GetContainerConfig, set state to an empty struct to avoid potential dereference segfaults, and pass it into RemoveContainer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, I have done some more refactoring and removed a good part of the duplicated code.
@mheon unrelated to this PR: here c is a pointer, and shadowing does not make sense: |
/ok-to-test |
f811890
to
0c39d07
Compare
@vrothberg, if I do like you said, then how can I call |
Why are we trying to force the Varlink API to follow CLI conventions? These
are separate operations and the API should treat them as such, even if we
decide to conflate in the command line.
…On Mon, Aug 19, 2019, 10:03 Marco Vedovati ***@***.***> wrote:
@vrothberg <https://github.com/vrothberg>, if I do like you said, then
how can I call iopodman.EvictContainer here?
https://github.com/containers/libpod/blob/128a1707f7d9e8df648a6ba353bfa16b9bef2431/pkg/adapter/containers_remote.go#L323-L339
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3549>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3AOCG455MHJDMG2GUSW4DQFKR25ANCNFSM4H7RUQJQ>
.
|
Any update on this PR? |
I am still willing to have this merged, just let me know if there's something to change. |
I think we're relatively close - I'll do another review pass on Monday. |
@marcov could you please rebase this PR? |
128a170
to
081d7b1
Compare
Rebased |
081d7b1
to
8fb722a
Compare
8fb722a
to
f862dfa
Compare
Failures looked unrelated at a first glance. I've rebased and let's see... |
@marcov, the error seems to be introduced with this PR. Running |
f862dfa
to
95e39de
Compare
Thank you @vrothberg, a mere glance was not enough 😆 |
Add ability to evict a container when it becomes unusable. This may happen when the host setup changes after a container creation, making it impossible for that container to be used or removed. Evicting a container is done using the `rm --force` command. Signed-off-by: Marco Vedovati <[email protected]>
95e39de
to
dacbc5b
Compare
Ok, tests now are better. I don't think the only test failing is related to this PR (hopefully I'm not wrong again) |
Ok this needs a review by @mheon and then we can merge. |
I think we have some unsettled debate about how and when to call this - but that can happen separately. |
(still needs /approve) |
Oops |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marcov, mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add ability to evict a container when it becomes unusable. This may
happen when the host setup changes after a container creation, making it
impossible for that container to be used or removed.
This may happen when you create a container with a specific runtime in libpod.conf, and later the runtime name is changed in the the conf, with outcome: